/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package main.EntityClassGraph;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import main.KBProcess.KnowledgeBaseDocument;
import org.jgrapht.graph.DefaultWeightedEdge;

/**
 *
 * @author Isaac Osesina
 */
public class EntityClassGraphEdge extends DefaultWeightedEdge implements Serializable, Cloneable{
   
    public static double increment = 1;
    private List<KnowledgeBaseDocument> knowledgeBaseDocumentSet;
    
    public EntityClassGraphEdge() {
        super();
        knowledgeBaseDocumentSet = new ArrayList<KnowledgeBaseDocument>();
    }
    
    
    public EntityClassGraphEdge(KnowledgeBaseDocument knowledgeBaseDocument) {        
        knowledgeBaseDocumentSet = new ArrayList<KnowledgeBaseDocument>();
        if(knowledgeBaseDocument != null)
            knowledgeBaseDocumentSet.add(knowledgeBaseDocument);
    }
    

    public double incrementWeight() {
        return super.getWeight() + increment;
    }

    @Override
    public double getWeight() {
        return super.getWeight()/2;
    }
    
    
    public List<KnowledgeBaseDocument> getKnowledgeBaseDocumentSet() {
        return knowledgeBaseDocumentSet;
    }
    
    

    public boolean containKnowledgeBaseDocument(KnowledgeBaseDocument knowledgeBaseDocument) {
        return knowledgeBaseDocumentSet.contains(knowledgeBaseDocument);
    }
    

    public boolean addKnowledgeBaseDocument(KnowledgeBaseDocument knowledgeBaseDocument) {
        if(knowledgeBaseDocument != null)
            return knowledgeBaseDocumentSet.add(knowledgeBaseDocument);
        return false;
    }
    
}
